﻿using System;

using RaisingStudio.Data;
using RaisingStudio.Data.Common;
using RaisingStudio.Data.Expressions;

namespace RaisingStudio.Data.Common
{
    public interface IDataObjectAdapter : ITransactionManager
    {
        int Delete(object[] primaryKeys);
        int Delete(object dataObject);
        int Delete(object dataObject, string transactionID);
        int Delete(object[] primaryKeys, string transactionID);
  
        bool Exists(object dataObject);
        bool Exists(object[] primaryKeys);
        bool Exists(object[] primaryKeys, string transactionID);
        bool Exists(object dataObject, string transactionID);
    
        int Fill(object dataObject, string transactionID);
        int Fill(object dataObject, object[] primaryKeys, string transactionID);
        int Fill(object dataObject, string[] columnNames, string transactionID);
        int Fill(object dataObject, object[] primaryKeys, string[] columnNames, string transactionID);
        int Fill(object dataObject, object[] primaryKeys, string[] columnNames);
        int Fill(object dataObject, string[] columnNames);
        int Fill(object dataObject, object[] primaryKeys);
        int Fill(object dataObject);
 
        object GetData(object dataObject, string[] columnNames, string transactionID);
        object GetData(object[] primaryKeys);
        object GetData(object[] primaryKeys, string[] columnNames, string transactionID);
        object GetData(object[] primaryKeys, string transactionID);
        object GetData(object dataObject, string transactionID);
        object GetData(object[] primaryKeys, string[] columnNames);
        object GetData(object dataObject, string[] columnNames);
        object GetData(object dataObject);
   
        System.Collections.IList GetDataList(string[] columnNames, int startRecord, int maxRecords, string transactionID);
        System.Collections.IList GetDataList(int startRecord, int maxRecords, string transactionID);
        System.Collections.IList GetDataList(CommonCommand conditionCommand, string transactionID);
        System.Collections.IList GetDataList(string[] columnNames, CommonCommand conditionCommand, string transactionID);
        System.Collections.IList GetDataList(string[] columnNames, CommonCommand conditionCommand, int startRecord, int maxRecords, string transactionID);
        System.Collections.IList GetDataList(CommonCommand conditionCommand, int startRecord, int maxRecords, string transactionID);
        System.Collections.IList GetDataList(string[] columnNames, string transactionID);
        System.Collections.IList GetDataList(string transactionID);
        System.Collections.IList GetDataList(string[] columnNames, int startRecord, int maxRecords);
        System.Collections.IList GetDataList(int startRecord, int maxRecords);
        System.Collections.IList GetDataList(string[] columnNames, CommonCommand conditionCommand, int startRecord, int maxRecords);
        System.Collections.IList GetDataList(CommonCommand conditionCommand, int startRecord, int maxRecords);
        System.Collections.IList GetDataList(string[] columnNames);
        System.Collections.IList GetDataList();
        System.Collections.IList GetDataList(string[] columnNames, CommonCommand conditionCommand);
        System.Collections.IList GetDataList(CommonCommand conditionCommand);
 
        System.Collections.IEnumerable GetEnumerator(string[] columnNames, int startRecord, int maxRecords, string transactionID);
        System.Collections.IEnumerable GetEnumerator(int startRecord, int maxRecords, string transactionID);
        System.Collections.IEnumerable GetEnumerator(string[] columnNames, CommonCommand conditionCommand, int startRecord, int maxRecords, string transactionID);
        System.Collections.IEnumerable GetEnumerator(CommonCommand conditionCommand, int startRecord, int maxRecords, string transactionID);
        System.Collections.IEnumerable GetEnumerator(string[] columnNames, string transactionID);
        System.Collections.IEnumerable GetEnumerator(string transactionID);
        System.Collections.IEnumerable GetEnumerator(string[] columnNames, CommonCommand conditionCommand, string transactionID);
        System.Collections.IEnumerable GetEnumerator(CommonCommand conditionCommand, string transactionID);
        System.Collections.IEnumerable GetEnumerator(string[] columnNames, int startRecord, int maxRecords);
        System.Collections.IEnumerable GetEnumerator(int startRecord, int maxRecords);
        System.Collections.IEnumerable GetEnumerator(string[] columnNames, CommonCommand conditionCommand, int startRecord, int maxRecords);
        System.Collections.IEnumerable GetEnumerator(CommonCommand conditionCommand, int startRecord, int maxRecords);
        System.Collections.IEnumerable GetEnumerator(string[] columnNames);
        System.Collections.IEnumerable GetEnumerator();
        System.Collections.IEnumerable GetEnumerator(string[] columnNames, CommonCommand conditionCommand);
        System.Collections.IEnumerable GetEnumerator(CommonCommand conditionCommand);
  
        int Insert(object dataObject, string[] columnNames);
        int Insert(object dataObject);
        int Insert(object dataObject, string[] columnNames, string transactionID);
        int Insert(object dataObject, string transactionID);

        int Save(object dataObject, string transactionID);
        int Save(object dataObject, string[] columnNames);
        int Save(object dataObject, string[] columnNames, string transactionID);
        int Save(object dataObject);
    
        int Update(object dataObject, string transactionID);
        int Update(object[] primaryKeys, object dataObject, string[] columnNames);
        int Update(object dataObject, string[] columnNames);
        int Update(object[] primaryKeys, object dataObject);
        int Update(object dataObject);
        int Update(object[] primaryKeys, object dataObject, string[] columnNames, string transactionID);
        int Update(object[] primaryKeys, object dataObject, string transactionID);
        int Update(object dataObject, string[] columnNames, string transactionID);
        
        #region Extension Functions
        #region Common Methods
        /// <summary>
        /// Fill Data object.
        /// </summary>
        /// <param name="dataObject">Data object.</param>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <returns>The result of execute command.</returns>
        int FillByPrimaryKey(object dataObject, object primaryKey);

        /// <summary>
        /// Fill Data object.
        /// </summary>
        /// <param name="dataObject">Data object.</param>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <returns>The result of execute command.</returns>
        int FillByPrimaryKey(object dataObject, object primaryKey, string[] columnNames);

        /// <summary>
        /// Gets Data object.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <returns>Data object.</returns>
        object GetDataByPrimaryKey(object primaryKey);

        /// <summary>
        /// Gets Data object.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <returns>Data object.</returns>
        object GetDataByPrimaryKey(object primaryKey, string[] columnNames);

        /// <summary>
        /// Delete Data object.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <returns>The count of rows that updated.</returns>
        int DeleteByPrimaryKey(object primaryKey);

        /// <summary>
        /// Update Data object.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="dataObject">Data object.</param>
        /// <returns>The count of rows that updated.</returns>
        int UpdateByPrimaryKey(object primaryKey, object dataObject);

        /// <summary>
        /// Update Data object.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="dataObject">Data object.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <returns>The count of rows that updated.</returns>
        int UpdateByPrimaryKey(object primaryKey, object dataObject, string[] columnNames);

        /// <summary>
        /// Check data object by primary key.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <returns>If exists then return true, otherwise return false.</returns>
        bool ExistsByPrimaryKey(object primaryKey);

        /// <summary>
        /// Gets Data object.
        /// </summary>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <returns>Data object.</returns>
        object GetDataByCondition(CommonCommand conditionCommand);

        /// <summary>
        /// Gets Data object.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <returns>Data object.</returns>
        object GetDataByCondition(string[] columnNames, CommonCommand conditionCommand);

        #region Epxression 
        /// <summary>
        /// Gets Data object.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>Data object.</returns>
        object GetDataByCondition(RaisingStudio.Data.Expressions.ConditionExpression conditionExpression);

        /// <summary>
        /// Gets Data object.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>Data object.</returns>
        object GetDataByCondition(string[] columnNames, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression);

        #region Batch Operation 
        /// <summary>
        /// Gets data object column table.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>data object column table.</returns>
        System.Collections.IList GetDataList(RaisingStudio.Data.Expressions.ConditionExpression conditionExpression);

        /// <summary>
        /// Gets data object column table.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>data object column table.</returns>
        System.Collections.IList GetDataList(string[] columnNames, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression);

        #region Paging Operation 
        /// <summary>
        /// Gets data object column table.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>data object column table.</returns>
        System.Collections.IList GetDataList(RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, int startRecord, int maxRecords);

        /// <summary>
        /// Gets data object column table.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>data object column table.</returns>
        System.Collections.IList GetDataList(string[] columnNames, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, int startRecord, int maxRecords);
        #endregion

        #region 迭代器
        /// <summary>
        /// Gets the enumerator of data objects.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>the enumerator of data objects.</returns>
        System.Collections.IEnumerable GetEnumerator(RaisingStudio.Data.Expressions.ConditionExpression conditionExpression);

        /// <summary>
        /// Gets the enumerator of data objects.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>the enumerator of data objects.</returns>
        System.Collections.IEnumerable GetEnumerator(string[] columnNames, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression);

        #region Paging Operation 
        /// <summary>
        /// Gets the enumerator of data objects.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>the enumerator of data objects.</returns>
        System.Collections.IEnumerable GetEnumerator(RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, int startRecord, int maxRecords);

        /// <summary>
        /// Gets the enumerator of data objects.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>the enumerator of data objects.</returns>
        System.Collections.IEnumerable GetEnumerator(string[] columnNames, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, int startRecord, int maxRecords);
        #endregion
        #endregion
        #endregion

        #region column name Epxression 
        /// <summary>
        /// Fill Data object.
        /// </summary>
        /// <param name="dataObject">Data object.</param>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The result of execute command.</returns>
        int Fill(object dataObject, object[] primaryKeys, ColumnExpression[] columnExpressions);

        /// <summary>
        /// Fill Data object.
        /// </summary>
        /// <param name="dataObject">has primary key value Data object.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The result of execute command.</returns>
        int Fill(object dataObject, ColumnExpression[] columnExpressions);

        /// <summary>
        /// Gets Data object.
        /// </summary>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>Data object.</returns>
        object GetData(object[] primaryKeys, ColumnExpression[] columnExpressions);

        /// <summary>
        /// Gets Data object.
        /// </summary>
        /// <param name="dataObject">has primary key value Data object.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>Data object.</returns>
        object GetData(object dataObject, ColumnExpression[] columnExpressions);

        /// <summary>
        /// Insert Data object.
        /// </summary>
        /// <param name="dataObject">Data object.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The count of rows that updated.</returns>
        int Insert(object dataObject, ColumnExpression[] columnExpressions);

        /// <summary>
        /// Update Data object.
        /// </summary>
        /// <param name="dataObject">Data object.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The count of rows that updated.</returns>
        int Update(object dataObject, ColumnExpression[] columnExpressions);

        /// <summary>
        /// Update Data object.
        /// </summary>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="dataObject">Data object.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The count of rows that updated.</returns>
        int Update(object[] primaryKeys, object dataObject, ColumnExpression[] columnExpressions);

        /// <summary>
        /// Save Data object.
        /// </summary>
        /// <param name="dataObject">Data object.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The count of rows that updated.</returns>
        int Save(object dataObject, ColumnExpression[] columnExpressions);

        /// <summary>
        /// Gets data object column table.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>data object column table.</returns>
        System.Collections.IList GetDataList(ColumnExpression[] columnExpressions);

        /// <summary>
        /// Gets data object column table.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>data object column table.</returns>
        System.Collections.IList GetDataList(ColumnExpression[] columnExpressions, int startRecord, int maxRecords);

        /// <summary>
        /// Gets the enumerator of data objects.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>the enumerator of data objects.</returns>
        System.Collections.IEnumerable GetEnumerator(ColumnExpression[] columnExpressions);

        /// <summary>
        /// Gets the enumerator of data objects.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>the enumerator of data objects.</returns>
        System.Collections.IEnumerable GetEnumerator(ColumnExpression[] columnExpressions, int startRecord, int maxRecords);

        /// <summary>
        /// Fill Data object.
        /// </summary>
        /// <param name="dataObject">Data object.</param>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The result of execute command.</returns>
        int FillByPrimaryKey(object dataObject, object primaryKey, ColumnExpression[] columnExpressions);

        /// <summary>
        /// Gets Data object.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>Data object.</returns>
        object GetDataByPrimaryKey(object primaryKey, ColumnExpression[] columnExpressions);

        /// <summary>
        /// Update Data object.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="dataObject">Data object.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The count of rows that updated.</returns>
        int UpdateByPrimaryKey(object primaryKey, object dataObject, ColumnExpression[] columnExpressions);

        /// <summary>
        /// Gets Data object.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>Data object.</returns>
        object GetDataByCondition(ColumnExpression[] columnExpressions, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression);

        /// <summary>
        /// Gets data object column table.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>data object column table.</returns>
        System.Collections.IList GetDataList(ColumnExpression[] columnExpressions, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression);

        /// <summary>
        /// Gets data object column table.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>data object column table.</returns>
        System.Collections.IList GetDataList(ColumnExpression[] columnExpressions, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, int startRecord, int maxRecords);

        /// <summary>
        /// Gets the enumerator of data objects.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>the enumerator of data objects.</returns>
        System.Collections.IEnumerable GetEnumerator(ColumnExpression[] columnExpressions, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression);

        /// <summary>
        /// Gets the enumerator of data objects.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>the enumerator of data objects.</returns>
        System.Collections.IEnumerable GetEnumerator(ColumnExpression[] columnExpressions, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, int startRecord, int maxRecords);
        #endregion
        #endregion
        #endregion
        #region Transaction
        /// <summary>
        /// Fill Data object.
        /// </summary>
        /// <param name="dataObject">Data object.</param>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The result of execute command.</returns>
        int FillByPrimaryKey(object dataObject, object primaryKey, string transactionID);

        /// <summary>
        /// Fill Data object.
        /// </summary>
        /// <param name="dataObject">Data object.</param>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The result of execute command.</returns>
        int FillByPrimaryKey(object dataObject, object primaryKey, string[] columnNames, string transactionID);

        /// <summary>
        /// Gets Data object.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Data object.</returns>
        object GetDataByPrimaryKey(object primaryKey, string transactionID);

        /// <summary>
        /// Gets Data object.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Data object.</returns>
        object GetDataByPrimaryKey(object primaryKey, string[] columnNames, string transactionID);

        /// <summary>
        /// Delete Data object.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        int DeleteByPrimaryKey(object primaryKey, string transactionID);

        /// <summary>
        /// Update Data object.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="dataObject">Data object.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        int UpdateByPrimaryKey(object primaryKey, object dataObject, string transactionID);

        /// <summary>
        /// Update Data object.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="dataObject">Data object.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        int UpdateByPrimaryKey(object primaryKey, object dataObject, string[] columnNames, string transactionID);

        /// <summary>
        /// Check data object by primary key.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>If exists then return true, otherwise return false.</returns>
        bool ExistsByPrimaryKey(object primaryKey, string transactionID);

        /// <summary>
        /// Gets Data object.
        /// </summary>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Data object.</returns>
        object GetDataByCondition(CommonCommand conditionCommand, string transactionID);

        /// <summary>
        /// Gets Data object.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Data object.</returns>
        object GetDataByCondition(string[] columnNames, CommonCommand conditionCommand, string transactionID);

        #region Epxression 
        /// <summary>
        /// Gets Data object.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Data object.</returns>
        object GetDataByCondition(RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, string transactionID);

        /// <summary>
        /// Gets Data object.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Data object.</returns>
        object GetDataByCondition(string[] columnNames, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, string transactionID);

        #region Batch Operation 
        /// <summary>
        /// Gets data object column table.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>data object column table.</returns>
        System.Collections.IList GetDataList(RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, string transactionID);

        /// <summary>
        /// Gets data object column table.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>data object column table.</returns>
        System.Collections.IList GetDataList(string[] columnNames, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, string transactionID);

        #region Paging Operation 
        /// <summary>
        /// Gets data object column table.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>data object column table.</returns>
        System.Collections.IList GetDataList(RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, int startRecord, int maxRecords, string transactionID);

        /// <summary>
        /// Gets data object column table.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>data object column table.</returns>
        System.Collections.IList GetDataList(string[] columnNames, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, int startRecord, int maxRecords, string transactionID);
        #endregion

        #region 迭代器
        /// <summary>
        /// Gets the enumerator of data objects.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the enumerator of data objects.</returns>
        System.Collections.IEnumerable GetEnumerator(RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, string transactionID);

        /// <summary>
        /// Gets the enumerator of data objects.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the enumerator of data objects.</returns>
        System.Collections.IEnumerable GetEnumerator(string[] columnNames, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, string transactionID);

        #region Paging Operation 
        /// <summary>
        /// Gets the enumerator of data objects.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the enumerator of data objects.</returns>
        System.Collections.IEnumerable GetEnumerator(RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, int startRecord, int maxRecords, string transactionID);

        /// <summary>
        /// Gets the enumerator of data objects.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the enumerator of data objects.</returns>
        System.Collections.IEnumerable GetEnumerator(string[] columnNames, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, int startRecord, int maxRecords, string transactionID);
        #endregion
        #endregion
        #endregion

        #region column name Epxression 
        /// <summary>
        /// Fill Data object.
        /// </summary>
        /// <param name="dataObject">Data object.</param>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The result of execute command.</returns>
        int Fill(object dataObject, object[] primaryKeys, ColumnExpression[] columnExpressions, string transactionID);

        /// <summary>
        /// Fill Data object.
        /// </summary>
        /// <param name="dataObject">has primary key value Data object.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The result of execute command.</returns>
        int Fill(object dataObject, ColumnExpression[] columnExpressions, string transactionID);

        /// <summary>
        /// Gets Data object.
        /// </summary>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>Data object.</returns>
        object GetData(object[] primaryKeys, ColumnExpression[] columnExpressions, string transactionID);

        /// <summary>
        /// Gets Data object.
        /// </summary>
        /// <param name="dataObject">has primary key value Data object.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>Data object.</returns>
        object GetData(object dataObject, ColumnExpression[] columnExpressions, string transactionID);

        /// <summary>
        /// Insert Data object.
        /// </summary>
        /// <param name="dataObject">Data object.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The count of rows that updated.</returns>
        int Insert(object dataObject, ColumnExpression[] columnExpressions, string transactionID);

        /// <summary>
        /// Update Data object.
        /// </summary>
        /// <param name="dataObject">Data object.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The count of rows that updated.</returns>
        int Update(object dataObject, ColumnExpression[] columnExpressions, string transactionID);

        /// <summary>
        /// Update Data object.
        /// </summary>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="dataObject">Data object.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The count of rows that updated.</returns>
        int Update(object[] primaryKeys, object dataObject, ColumnExpression[] columnExpressions, string transactionID);

        /// <summary>
        /// Save Data object.
        /// </summary>
        /// <param name="dataObject">Data object.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The count of rows that updated.</returns>
        int Save(object dataObject, ColumnExpression[] columnExpressions, string transactionID);

        /// <summary>
        /// Gets data object column table.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>data object column table.</returns>
        System.Collections.IList GetDataList(ColumnExpression[] columnExpressions, string transactionID);

        /// <summary>
        /// Gets data object column table.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>data object column table.</returns>
        System.Collections.IList GetDataList(ColumnExpression[] columnExpressions, int startRecord, int maxRecords, string transactionID);

        /// <summary>
        /// Gets the enumerator of data objects.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>the enumerator of data objects.</returns>
        System.Collections.IEnumerable GetEnumerator(ColumnExpression[] columnExpressions, string transactionID);

        /// <summary>
        /// Gets the enumerator of data objects.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>the enumerator of data objects.</returns>
        System.Collections.IEnumerable GetEnumerator(ColumnExpression[] columnExpressions, int startRecord, int maxRecords, string transactionID);

        /// <summary>
        /// Fill Data object.
        /// </summary>
        /// <param name="dataObject">Data object.</param>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The result of execute command.</returns>
        int FillByPrimaryKey(object dataObject, object primaryKey, ColumnExpression[] columnExpressions, string transactionID);

        /// <summary>
        /// Gets Data object.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>Data object.</returns>
        object GetDataByPrimaryKey(object primaryKey, ColumnExpression[] columnExpressions, string transactionID);

        /// <summary>
        /// Update Data object.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="dataObject">Data object.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The count of rows that updated.</returns>
        int UpdateByPrimaryKey(object primaryKey, object dataObject, ColumnExpression[] columnExpressions, string transactionID);

        /// <summary>
        /// Gets Data object.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>Data object.</returns>
        object GetDataByCondition(ColumnExpression[] columnExpressions, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, string transactionID);

        /// <summary>
        /// Gets data object column table.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>data object column table.</returns>
        System.Collections.IList GetDataList(ColumnExpression[] columnExpressions, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, string transactionID);

        /// <summary>
        /// Gets data object column table.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>data object column table.</returns>
        System.Collections.IList GetDataList(ColumnExpression[] columnExpressions, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, int startRecord, int maxRecords, string transactionID);

        /// <summary>
        /// Gets the enumerator of data objects.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>the enumerator of data objects.</returns>
        System.Collections.IEnumerable GetEnumerator(ColumnExpression[] columnExpressions, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, string transactionID);

        /// <summary>
        /// Gets the enumerator of data objects.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>the enumerator of data objects.</returns>
        System.Collections.IEnumerable GetEnumerator(ColumnExpression[] columnExpressions, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, int startRecord, int maxRecords, string transactionID);
        #endregion
        #endregion
        #endregion
        #endregion
    }
}
